package com.dongbei.baseproject.base

import android.content.Context
import android.os.Bundle
import android.view.View
import androidx.annotation.IdRes
import androidx.fragment.app.Fragment

abstract class BaseFragment : Fragment() {

    companion object {
        private const val WAITING_TIME_FOR_HIDE_KEYBOARD = 300L
    }


    override fun onAttach(context: Context) {
        super.onAttach(context)
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        initView()
        initData()
    }

    override fun onResume() {
        super.onResume()
    }

    override fun onPause() {
        super.onPause()

    }

    override fun onStop() {
        super.onStop()

    }

    override fun onDestroyView() {
        super.onDestroyView()

    }

    override fun onDestroy() {
        super.onDestroy()
    }

    /**
     * 初始化组件
     */
     abstract fun initView()

    /**
     * 设置数据
     */
     abstract fun initData()

    @IdRes
    internal open fun getContainerId(): Int = -1

    open fun shouldHookBaseHideKeyboard(): Boolean = false
}
